package com.tsll.entity;

import java.io.Serializable;

/**
 * 
 * @TableName ebookcomment
 */
public class EbookComment implements Serializable {
    /**
     * 电子书评论id
     */
    private Integer ebookcommentId;

    /**
     * 评论内容
     */
    private String ebookcommentMessage;

    /**
     * 电子书id
     */
    private Integer ebookId;

    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 用户实体类
     */
    private User user;
    /**
     * 图书实体类
     */
    private Ebook ebook;

    private static final long serialVersionUID = 1L;

    public Integer getEbookcommentId() {
        return ebookcommentId;
    }

    public void setEbookcommentId(Integer ebookcommentId) {
        this.ebookcommentId = ebookcommentId;
    }

    public String getEbookcommentMessage() {
        return ebookcommentMessage;
    }

    public void setEbookcommentMessage(String ebookcommentMessage) {
        this.ebookcommentMessage = ebookcommentMessage;
    }

    public Integer getEbookId() {
        return ebookId;
    }

    public void setEbookId(Integer ebookId) {
        this.ebookId = ebookId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public EbookComment() {
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Ebook getEbook() {
        return ebook;
    }

    public void setEbook(Ebook ebook) {
        this.ebook = ebook;
    }

    public EbookComment(Integer ebookcommentId, String ebookcommentMessage, Integer ebookId, Integer userId, User user, Ebook ebook) {
        this.ebookcommentId = ebookcommentId;
        this.ebookcommentMessage = ebookcommentMessage;
        this.ebookId = ebookId;
        this.userId = userId;
        this.user = user;
        this.ebook = ebook;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EbookComment other = (EbookComment) that;
        return (this.getEbookcommentId() == null ? other.getEbookcommentId() == null : this.getEbookcommentId().equals(other.getEbookcommentId()))
            && (this.getEbookcommentMessage() == null ? other.getEbookcommentMessage() == null : this.getEbookcommentMessage().equals(other.getEbookcommentMessage()))
            && (this.getEbookId() == null ? other.getEbookId() == null : this.getEbookId().equals(other.getEbookId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEbookcommentId() == null) ? 0 : getEbookcommentId().hashCode());
        result = prime * result + ((getEbookcommentMessage() == null) ? 0 : getEbookcommentMessage().hashCode());
        result = prime * result + ((getEbookId() == null) ? 0 : getEbookId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ebookcommentId=").append(ebookcommentId);
        sb.append(", ebookcommentMessage=").append(ebookcommentMessage);
        sb.append(", ebookId=").append(ebookId);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}